<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>添加</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <script src="../../../../lib/include.js"></script>
    <link rel="stylesheet" href="../../../../../../public-tools/pc/plugins/bootstrap-fileinput/css/fileinput.min.css">
    <link rel="stylesheet" href="../../../../../../public-tools/pc/plugins/bootstrap-select-1.12.4/css/bootstrap-select.min.css">

    <style>
        .form-control {
            margin-bottom: 8px;
        }

        .form-control:focus,
        .single-line:focus {
            border-color: #0e9aef !important;
        }

        .radio-inline {
            line-height: 5px;
        }
        .dropdown-menu.inner {
            background-color: #1ab394;
            color: white;
        }
        .dropdown-menu.open {
            border-radius: 5px;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content" id="app" v-cloak>

    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <form id="Form" autocomplete="off">
                <div style="padding: 0">
                    <input type="hidden" name="id">
                    <input type="hidden" name="version" value="0">
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-12">
                            <label class="form-inline">标题</label>
                            <div>
                                <input type="text" id="title" class="form-control" name="title" placeholder="请输入标题">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-12">
                            <label class="form-inline">活动类别</label>
                            <div>
                                <select class="form-control" name="classId">
                                    <option v-for="(item,index) in selects" :value="item.id">{{item.name}}</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-3">
                            <label class="form-inline">是否发布</label>
                            <div>
                                <select class="form-control" name="isPush">
                                    <option  v-if="isPush == -1" value="-1">取消发布</option>
                                    <option value="1">发布</option>
                                    <option value="0" selected>不发布</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">是否置顶</label>
                            <div>
                                <select class="form-control" name="isTop">
                                    <option value="1">置顶</option>
                                    <option value="0" selected>不置顶</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">销售限制</label>
                            <div>
                                <input type="number" class="form-control" min="0" value="" name="salesLimit"
                                       placeholder="请输入销售限制">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">排序</label>
                            <div>
                                <input type="number" class="form-control" value="100" name="sort"
                                       placeholder="请输入排序（数字大的排在前面）">
                            </div>
                        </div>
                    </div>


                    <div class="col-sm-12 form-group">
                        <div class="col-sm-12">
                            <label class="form-inline">活动描述</label>
                            <div>
                            <textarea name="describe" class="form-control" rows="3" maxlength="999"
                                      placeholder="请输入活动描述">{{desc}}</textarea>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-8">
                            <label class="form-inline">活动地点</label>
                            <div>
                                <input class="form-control" type="text" name="place" id="place" maxlength="250" @change="changePlace"
                                       placeholder="请输入详细活动地点">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">活动地点经/纬度<font style="color:red;display: none" id="latLngMsg">【地址不存在！】</font></label>
                            <div>
                                <input class="form-control" type="text" autoComplete='off' name="latLng"
                                       readonly placeholder="请输入详细活动地点获取经纬度">
                                <input type="hidden" name="address">
                                <input type="hidden" name="country">
                                <input type="hidden" name="province">
                                <input type="hidden" name="city">
                                <input type="hidden" name="street">
                                <input type="hidden" name="gpsType">
                                <input type="hidden" name="type">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-8">
                            <label class="form-inline">活动标签</label>
                            <div>
                                <select class="selectpicker form-control" id="tags" multiple name="tags"
                                        data-actions-box="false" >
                                    <!--                                    <option v-for="(item,index) in selects" :value="item.id">{{item.name}}</option>-->
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <label class="form-inline">活动场地</label>
                            <div>
                                <select :disabled="isDisable" class="form-control" name="placeId" id="placeId">
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-3">
                            <label class="form-inline">报名截止时间</label>
                            <div>
                                <input class="form-control" name="applyEndTime"
                                       onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"
                                       placeholder="请选择报名截止时间" style="cursor: pointer">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">活动开始时间</label>
                            <div>
                                <input class="form-control" name="beginTime"
                                       onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"
                                       placeholder="请选择开始时间" style="cursor: pointer">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">活动结束时间</label>
                            <div>
                                <input class="form-control" name="endTime"
                                       onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"
                                       placeholder="请选择结束时间" style="cursor: pointer">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">签到开始时间 <font
                                    style="color: red;font-size: 12px">注：活动开始时签到结束</font></label>
                            <div>
                                <input class="form-control" name="signIn"
                                       onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"
                                       placeholder="请选择签到开始时间" style="cursor: pointer">
                            </div>
                        </div>

                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-3">
                            <label class="form-inline">参与人数</label>
                            <div>
                                <input class="form-control" min="0" type="number" name="maleLimit"
                                       placeholder="请输入参与人数">
                            </div>
                        </div>
                        <input type="hidden" name="femaleLimit" value="0">
                        <!--<div class="col-sm-3">
                            <label class="form-inline">报名费用</label>
                            <div class="input-group">
                                <input class="form-control" type="text" name="signUpFee" id="signUpFee"
                                       placeholder="请输入报名费用）">
                                <div class="input-group-addon">元/人</div>
                            </div>
                        </div>-->
                        <div class="col-sm-3">
                            <label class="form-inline">收费标准</label>
                            <div>
                                <input class="form-control" type="text" name="charge" maxlength="250"
                                       placeholder="请输入收费标准，如：10元/人（VIP会员免费）">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">活动负责人联系方式</label>
                            <div>
                                <input class="form-control" type="text" name="tel" maxlength="15"
                                       placeholder="请输入活动负责人联系方式">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <label class="form-inline">售票类型 <span style="color: red;">【活动售票类型中配置】</span></label>
                            <div>
                                <select @change="selectSale" class="form-control" name="saleId" id="saleId">
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">校区</label>
                        <div class="col-sm-4">
                            <select class="form-control" name="schoolId" >
                                <option v-if="schoolId == ''" value="">---公用---</option>
                                <option v-for="(value, key) in schoolList" :key="key" :value="key">---{{value}}---</option>
                            </select>
                        </div>
                        <label class="col-sm-2 control-label">场景</label>
                        <div class="col-sm-4">
                            <select class="form-control" name="activityType" >
                                <option value="">---公用---</option>
                                <option value="1">---面向家长---</option>
                                <option value="2">---面向老师---</option>
                                <option value="3">---面向校长---</option>
                            </select>
                        </div>
                    </div>

                    <div class="col-sm-12 " v-if="saleTypes.length>0">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title" @click="getSaleMap">售票类型配置 <span style="color: red">【1.预付款与票价相等时，用户将直接全款支付；2.若一类为全款，其他类型都应为全款。】</span> </h3>
                            </div>
                            <div class="panel-body">
                                <div v-for="(item,index) in saleTypes" class="alert alert-warning alert-dismissible" role="alert" style="width: 90%;margin-right: 15px;display: inline-block;padding: 10px 35px 10px 10px">
                                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                    <div class="input-group">
                                        <div class="input-group-addon">{{item.name}}</div>
                                        <div class="input-group-addon">原价</div>
                                        <input class="form-control ticket-oldPrice" min="0" oninput="value=value.replace(/[^\d(\.\d{1,2})]/g,'')" v-model="item.oldPrice" @input="minValue(index,3)" :data-typeid="item.id" :data-typename="item.name" type="number" placeholder="请输入费用">
                                        <div class="input-group-addon">元/人</div>
                                        <div class="input-group-addon">票价</div>
                                        <input class="form-control ticket-price" min="0" oninput="value=value.replace(/[^\d(\.\d{1,2})]/g,'')" v-model="item.price" @input="minValue(index,1)" :data-typeid="item.id" :data-typename="item.name" type="number" placeholder="请输入费用">
                                        <div class="input-group-addon">元/人</div>
                                        <div class="input-group-addon">预付款</div>
                                        <input class="form-control ticket-prePrice" min="0" oninput="value=value.replace(/[^\d(\.\d{1,2})]/g,'')" v-model="item.prePrice" @input="minValue(index,4)" :data-typeid="item.id" :data-typename="item.name" type="number" placeholder="请输入费用">
                                        <div class="input-group-addon">元/人</div>

                                        <div class="input-group-addon">共</div>
                                        <input class="form-control ticket-amount" min="0" oninput="value=value.replace(/[^\d]/g,'')" v-model="item.allAmount" @input="minValue(index,2)" :data-typeid="item.id" :data-typename="item.name" type="number" placeholder="请输入数量">
                                        <div class="input-group-addon">张</div>
<!--                                        <div class="input-group-addon" style="color: red" v-if="salePoint!=null&&salePoint!=0">实收:{{item.price*(1-salePoint) | numFilter}}</div>-->
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">阅读原文URL</label>
                        <div class="col-sm-10">
                            <div class="col-sm-10" style="padding: 0">
                                <input type="text" class="form-control" id="contentUrl" name="contentUrl" placeholder="请输入阅读原文URL">
                            </div>
                            <div class="col-sm-2" style="padding: 0">
                                <a href="javascript:void(0);" @click="getWxArticle" class="form-control btn btn-default"
                                   style="width: 100%;background-color: #0d8ddb;color: white">获取微信文章</a>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 ">
                        <label class="form-inline">活动详情</label>
                        <div>
                            <input id="details" type="hidden" name="details">
                            <div id="editor">
                            </div>
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px">
                        <label class="form-inline">图片<font style="color: red">尺寸：【700px*300px】</font></label>
                        <input id="activityImg" type="hidden" name="imgId">
                        <input type="hidden" id="oldImgId" name="oldImgId">
                        <div class="file-loading">
                            <input id="fileUploadBtn" type="file" name="file">
                        </div>
                    </div>

                </div>

                <div style="text-align: center" v-if="isPush != -1 && isPush != 1">
                    <a href="javascript:parent.layer.closeAll();" class="btn btn-default" style="width: 10%;">关 闭</a>
                    <button type="submit" class="btn btn-primary" style="width: 10%;" v-if="permission(0)">保存</button>
                    <button type="submit" class="btn btn-primary" style="width: 10%;" v-else="permission(1)">保存</button>
                </div>
                <div style="text-align: center" v-if="isPush == -1 || isPush == 1">
                    <a href="javascript:parent.layer.closeAll();" class="btn btn-default" style="width: 10%;">关 闭</a>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="../../../../../../public-tools/pc/plugins/wangEditor/wangEditor-video.js"></script>
<script src="../../../../../../public-tools/pc/plugins/bootstrap-fileinput/js/fileinput.min.js"></script>
<script src="../../../../../../public-tools/pc/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="../../../../../../public-tools/pc/plugins/bootstrap-select-1.12.4/js/bootstrap-select.min.js"></script>
<script src="../../../../js/content-manage/activity/list/edit.js"></script>
</body>
</html>
